<?php 
define("DIR",dirname(__FILE__));
// echo DIR;
define("APPNAME","alipay");
ini_set("include_path", ini_get("include_path").PATH_SEPARATOR.DIR."/been");//设置框架所在目录为目录为include_path

include_once "App.class.php";
include_once "Db.php";


$app=App::getInstance();
$app->setConfPath(DIR."/setting");
$db = new Db($app->loadConf("db"));
$statistics = new statistics($db);
$List1 = $statistics->getKeywordsRanking(8,-7);
//var_dump($List1);


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="common/libs/jquery-1.9.1.js"></script>
<script type="text/javascript" src="common/libs/jquery-migrate-1.1.0.min.js"></script>
<script type="text/javascript" src="common/libs/AwesomeChartJS-master/awesomechart.js"></script>
<body>
 	<div class="chart_container">
       <canvas id="chartCanvas1" width="400" height="400">
                    Your web-browser does not support the HTML 5 canvas element.
		 </canvas>
	</div>
</body>
	<script type="application/javascript">
	var chart1 = new AwesomeChart('chartCanvas1');
            chart1.title = "根据关键字搜索排名";
            var list1=eval(<?php echo json_encode($List1);?>);
            list1.forEach(function(i){
            	//alert(i);
            	chart1.data.push(i['num']);
            	chart1.labels.push(i['ex_keywords']);
            });
            //chart1.data = [list1[0]['num'],31.3,10.06,4.27,1.96,0.78];
            //chart1.labels = ['IE','Firefox','Chrome','Safari','Opera','Other'];
            chart1.draw();
	</script>

</html>